#include "qint64item.h"
#include <QDebug>
#include <QLocale>
QInt64Item::QInt64Item(qint64 data):QTableWidgetItem(QTableWidgetItem::UserType + 1)
{
    m_data = data;
    this->setFlags(Qt::ItemIsEnabled);
    this->setTextAlignment(Qt::AlignVCenter | Qt::AlignRight );
}

QVariant QInt64Item::data(int role) const
{
    QLocale defaultLocale;
    if (role==Qt::EditRole)
        return m_data;
    else if (role==Qt::DisplayRole)
        return defaultLocale.toString(m_data);
    else
        return QTableWidgetItem::data(role);
}

bool QInt64Item::operator< ( const QTableWidgetItem& other ) const
{
    return m_data < ((QInt64Item&)other).m_data;
}
